<HTML>
<HEAD>
<TITLE>JavaScript Source Code 2002:  Password Protection Scripts</TITLE>
<META HTTP-EQUIV="JavaScript Source Code 2002" CONTENT="no-cache">
<META NAME="date" CONTENT="2000-09-09">
<META NAME="channel" CONTENT="Web Developer">
<META NAME="author" CONTENT="JavaScript Source Code 2002">
<META NAME="section" CONTENT="Password Protection">
<META NAME="description" CONTENT="JavaScript Password Protection -- These scripts all deal with JavaScript Password Protection scripts.  They are an elementary attempt to protect a site and should NOT be used to protect Top Secret information.  They just keep the amateurs out.  Pros can infiltrate such sites with these forms of protection.  But, for free, they do a good job.">
<meta name="keywords" content="javascript password protection cookies multiple users password prompt three tries login coder password pro">
<meta name="ROBOTS" content="ALL">
<meta name="title" content="JavaScript Source Code 2002 - Password Protection Scripts">
<meta name="subject" content="JavaScript">
<LINK REL="stylesheet" href="../styles/jsstyles.css" /styles/jsstyles.css" type="text/css">
</HEAD>

<BODY>

<BR>

</CENTER>

<P CLASS="listingtxt">
These scripts all deal with JavaScript Password Protection scripts.  They are an elementary attempt to protect a site and should NOT be used to protect Top Secret information.  They just keep the amateurs out.  Pros can infiltrate such sites with these forms of protection.  But, for free, they do a good job. They are very difficult to write - just look at the code.  
<hr noshade size=5 class="listing"></P>

<!--content_start-->

<P CLASS="listingtxt">
<b>Title:</b> <a name="ASCII_Encryption" href="ascii-encryption.html" /passwords/ascii-encryption.html">ASCII Encryption</a><br><b>Contributor:</b>  <a href="mailto:david.salsinha@popsi.pt">David Salsinha</a>  (<a href="mailto:david.salsinha@popsi.pt">david.salsinha@popsi.pt</a>)<br><b>Details:</b> 1.83 KB * Uploaded August 31 2000<br><b>Description:</b>  (Internet Explorer Only)  A very simple encryption method that uses random values for each character.  Interestingly, you can encrypt the same string as many times as you want and the result will always be different.  Best used with short strings.</P><P CLASS="listingalign" align=right>[ <a href="ascii-encryption.html#source" /passwords/ascii-encryption.html#source">Get Source Code</a> ]
<hr noshade size=5 class="listing"></P>

<P CLASS="listingtxt">
<b>Title:</b> <a name="Character_Encoder" href="character-encoder.html" /passwords/character-encoder.html">Character Encoder</a><br><b>Contributor:</b>  <a href="mailto:mike_mcgrath@lineone.net">Mike McGrath</a>  (<a href="mailto:mike_mcgrath@lineone.net">mike_mcgrath@lineone.net</a>)<br><b>Contributor URL:</b>&nbsp;<a href="javascript:if(confirm('http://website.lineone.net/~mike_mcgrath/  \n\nYou must be connected to the Internet to access this link.  \n\nDo you want to open it from the server?'))window.location='http://website.lineone.net/~mike_mcgrath/'" tppabs="http://website.lineone.net/~mike_mcgrath/">http://website.lineone.net/~mike_mcgrath/</a><br><b>Details:</b> 1.86 KB * Uploaded November 24 1999<br><b>Description:</b>  Encrypts a string by converting each character to it's ASCII key code.  Supports two-way encryption - from a string to the numeric code, or from the numeric code back to the string.  You can, for example, send the encrypted code to a friend and have them decode it with this script.  Lots more uses, use your imagination!</P><P CLASS="listingalign" align=right>[ <a href="character-encoder.html#source" /passwords/character-encoder.html#source">Get Source Code</a> ]
<hr noshade size=5 class="listing"></P>

<P CLASS="listingtxt">
<b>Title:</b> <a name="cookie" href="cookie.html" /passwords/cookie.html">Cookie Protection</a><BR><b>Details:</b> 5.19 KB * Uploaded August 13 1997<br><b>Description:</b>You can use a basic cookie script to keep visitors (that don't have the cookie on their system) from viewing certain parts of your site (kind of.... There are always ways around it). The cookie is placed when the password provided is correct. Then, when they are forwarded to the password protected page, the cookie allows them to stay. Those without the cookie are sent back. </P><P CLASS="listingalign" align=right>[ <a href="cookie-in.html#source" /passwords/cookie-in.html#source">Get Source Code</a> ]
<hr noshade size=5 class="listing"></P>

<P CLASS="listingtxt">
<b>Title:</b> <a name="gatekeeper" href="gatekeeper.html" /passwords/gatekeeper.html">Gatekeeper</a><BR><b>Details:</b> 2.97 KB * Uploaded August 13 1997<br><b>Description:</b>  Here is the best password protection script I have come across.  It is also definitely the most user friendly.  Try it out!  (Note:  The password is the filename without the .html ending.)  This password for this example is gatekeeper-in</P><P CLASS="listingalign" align=right>[ <a href="gatekeeper-in.html#source" /passwords/gatekeeper-in.html#source">Get Source Code</a> ]
<hr noshade size=5 class="listing"></P>

<P CLASS="listingtxt">
<b>Title:</b> <a name="login-coder" href="login-coder.html" /passwords/login-coder.html">Login Coder</a><br><B>Contributor:</B>  <a href="javascript:if(confirm('http://www.iinet.net.au/~biab/  \n\nYou must be connected to the Internet to access this link.  \n\nDo you want to open it from the server?'))window.location='http://www.iinet.net.au/~biab/'" tppabs="http://www.iinet.net.au/~biab/">Dion</a><BR><B>Contributor URL:</B>&nbsp;<a href="javascript:if(confirm('http://www.iinet.net.au/~biab/  \n\nYou must be connected to the Internet to access this link.  \n\nDo you want to open it from the server?'))window.location='http://www.iinet.net.au/~biab/'" tppabs="http://www.iinet.net.au/~biab/">http://www.iinet.net.au/~biab/</A><BR><b>Details:</b> 6.50 KB * Uploaded May 29 1998<br><b>Description:</b>  This is undoubtedly the best password protection JavaScript you'll ever find.  Besides supporting multiple users, multiple passwords, and even multiple destination pages (after they successfully login), this script is presented in a very easy-to-use interface that you're sure to love!  We *wish* we wrote this script, it's that good!  (Note:  Questions on this script should be directed to the <a href="javascript:if(confirm('http://www.iinet.net.au/~biab/  \n\nYou must be connected to the Internet to access this link.  \n\nDo you want to open it from the server?'))window.location='http://www.iinet.net.au/~biab/'" tppabs="http://www.iinet.net.au/~biab/">author</a>.)</P><P CLASS="listingalign" align=right>[ <a href="login-coder.html#source" /passwords/login-coder.html#source">Get Source Code</a> ]
<hr noshade size=5 class="listing"></P>

<P CLASS="listingtxt">
<b>Title:</b> <a name="multiple-users" href="multiple-users.html" /passwords/multiple-users.html">Multiple Users (Login Table)</a><BR><b>Details:</b> 1.60 KB * Uploaded May 15 1998<br><b>Description:</b>  Rather not have one password for access the Members-Only section of your site?  Well, along comes this little JavaScript gem.  You can set up a separate username and password for as many members as you want, and even give each a different page to go to after logging in!</P><P CLASS="listingalign" align=right>[ <a href="multiple-users-source.html#source" /passwords/multiple-users-source.html#source">Get Source Code</a> ]
<hr noshade size=5 class="listing"></P>
<P>
<P> 
<P CLASS="listingtxt">
<b>Title:</b> <a name="multiple-users-prompt" href="multiple-users-prompt.html" /passwords/multiple-users-prompt.html">Multiple Users (Prompt)</a><BR><b>Details:</b> 1.29 KB * Uploaded May 15 1998<br><b>Description:</b>  This JavaScript is just like the previous Multiple Users one, but doesn't use a table interface to login.  Instead, after clicking the Login! button, the script will ask them for their username and password, and then perform the password-protection.  Very neat!</P><P CLASS="listingalign" align=right>[ <a href="multiple-users-prompt-source.html#source" /passwords/multiple-users-prompt-source.html#source">Get Source Code</a> ]
<hr noshade size=5 class="listing"></P>

<P CLASS="listingtxt">
<b>Title:</b> <a name="Password_Generator" href="password-generator.html" /passwords/password-generator.html">Password Generator</a><br><b>Contributor:</b>  <a href="mailto:ataxx@visto.com">ataxx@visto.com</a>  (<a href="mailto:ataxx@visto.com">ataxx@visto.com</a>)<br><b>Details:</b> 3.49 KB * Uploaded October 27 2000<br><b>Description:</b>  Generate a random password with the ability to include special characters and password restrictions.</P><P CLASS="listingalign" align=right>[ <a href="password-generator.html#source" /passwords/password-generator.html#source">Get Source Code</a> ]
<hr noshade size=5 class="listing"></P>

<P CLASS="listingtxt">
<b>Title:</b> <a name="password-pro" href="password-pro.html" /passwords/password-pro.html">Password Pro</a><BR><B>Contributor:</B>  <a href="mailto:lef@writeme.com">Lefteris Haritou</a>&nbsp;(<a href="mailto:lef@writeme.com">lef@writeme.com</a>)<BR><B>Contributor URL:</B>&nbsp;<a href="javascript:if(confirm('http://www.geocities.com/~lef  \n\nYou must be connected to the Internet to access this link.  \n\nDo you want to open it from the server?'))window.location='http://www.geocities.com/~lef'" tppabs="http://www.geocities.com/~lef">http://www.geocities.com/~lef</A><BR><b>Details:</b> 2.55 KB * Uploaded October 26 1997<br><b>Description:</b>  This script uses a different approach to Password Protection. It still uses the password as the actual page, but it uses an encryption method that encrypts and checks the password. So if you fail to enter it correct after 3 times you go to a specific page (specified by the webmaster) and you don't get the annoying 404 page not found message as in other scripts. The password is password</P><P CLASS="listingalign" align=right>[ <a href="password-pro-in.html#source" /passwords/password-pro-in.html#source">Get Source Code</a> ]
<hr noshade size=5 class="listing"></P>

<P CLASS="listingtxt">
<b>Title:</b> <a name="prompt" href="prompt.html" /passwords/prompt.html">Password Prompt</a><BR><b>Details:</b> 0.58 KB * Uploaded August 13 1997<br><b>Description:</b>  If a visitor wants to go a password protected page, they must first enter the correct password on the page with this script.  This script will just take you them to [password entered].html This is a very good script if JavaScript is enabled and as long as you have an index.html file in your directory. As an added bonus, it's only 8 lines!  The password is the protected filename without the .html ending.</P><P CLASS="listingalign" align=right>[ <a href="prompt-in.html#source" /passwords/prompt-in.html#source">Get Source Code</a> ]
<hr noshade size=5 class="listing"></P>

<P CLASS="listingtxt">
<b>Title:</b> <a name="Text_Encryption" href="text-encryption.html" /passwords/text-encryption.html">Text Encryption</a><br><b>Contributor:</b>  <a href="mailto:tsereg@net.hr">Tomislav Sereg</a>  (<a href="mailto:tsereg@net.hr">tsereg@net.hr</a>)<br><b>Contributor URL:</b>&nbsp;<a href="javascript:if(confirm('http://www.inet.hr/~tsereg/jse  \n\nYou must be connected to the Internet to access this link.  \n\nDo you want to open it from the server?'))window.location='http://www.inet.hr/~tsereg/jse'" tppabs="http://www.inet.hr/~tsereg/jse">http://www.inet.hr/~tsereg/jse</a><br><b>Details:</b> 8.32 KB * Uploaded August 3 2000<br><b>Description:</b>  This JavaScript library provides encryption using simple, text-oriented method called column transposition. The idea is to write the plain text in block on the row-first bases. The text is then read column-first. The trick is in that the columns are not read from left to right, but in the order specified by the encryption key. Transliteration is also used.</P><P CLASS="listingalign" align=right>[ <a href="text-encryption.html#source" /passwords/text-encryption.html#source">Get Source Code</a> ]
<hr noshade size=5 class="listing"></P>

<P CLASS="listingtxt">
<b>Title:</b> <a name="threetries" href="three-tries.html" /passwords/three-tries.html">Three Tries</a><BR><b>Details:</b> 1.10 KB * Uploaded August 13 1997<br><b>Description:</b>  If you want to 'protect' a site and don't have CGI access, you can try this JavaScript.  Visitors get three tries to enter the correct password then they are refused entry.  Note: The password is: password  </P><P CLASS="listingalign" align=right>[ <a href="three-tries.html#source" /passwords/three-tries.html#source">Get Source Code</a> ]
<hr noshade size=5 class="listing"></P>

<P CLASS="listingtxt">
<b>Title:</b> <a name="Virgenere_Encryption" href="virgenere-encryption.html" /passwords/virgenere-encryption.html">Virgenere Encryption</a><br><b>Contributor:</b>  <a href="mailto:iopossum@mailcity.com">Francisco Ryan Tolmasky</a>  (<a href="mailto:iopossum@mailcity.com">iopossum@mailcity.com</a>)<br><b>Contributor URL:</b>&nbsp;<a href="javascript:if(confirm('http://iopossum.tripod.com/  \n\nYou must be connected to the Internet to access this link.  \n\nDo you want to open it from the server?'))window.location='http://iopossum.tripod.com/'" tppabs="http://iopossum.tripod.com/">http://iopossum.tripod.com</a><br><b>Details:</b> 2.99 KB * Uploaded September 4 2000<br><b>Description:</b>  A fine example of the classic virgenere script and is nearly impossible to decode, even when using frequency analysis.  This script is also entertaining since you can actually see the encryption taking place.</P><P CLASS="listingalign" align=right>[ <a href="virgenere-encryption.html#source" /passwords/virgenere-encryption.html#source">Get Source Code</a> ]
<hr noshade size=5 class="listing"></P>

<P CLASS="listingtxt">
<b>Title:</b> <a name="XOR_Encryption" href="xor-encryption.html" /passwords/xor-encryption.html">XOR Encryption</a><br><b>Contributor:</b>  <a href="mailto:kaiser40@yahoo.com">Terry Yuen</a>  (<a href="mailto:kaiser40@yahoo.com">kaiser40@yahoo.com</a>)<br><b>Details:</b> 3.97 KB * Uploaded August 11 2000<br><b>Description:</b>  Performs a bitwise XOR (Exclusive Or) on each byte of the data you wish to encrypt using the key you provide.  Useful as an additional security precaution when sending sensitive information over the Internet.  (However, this method is not foolproof and should not be your only form of security.)  The author notes that longer and more random keys increase the strength of the encryption.  Neat!</P><P CLASS="listingalign" align=right>[ <a href="xor-encryption.html#source" /passwords/xor-encryption.html#source">Get Source Code</a> ]
<hr noshade size=5 class="listing"></P>

</FONT>
</CENTER>

</CENTER>